 /**
 * @file tkl_find_bind.h
 * @brief Common process - find & bind
 * @version 1.0.0
 * @date 2021-05-13
 *
 * @copyright Copyright 2021-2022 Tuya Inc. All Rights Reserved.
 *
 */

#ifndef __TKL_FIND_BIND_H__
#define __TKL_FIND_BIND_H__


#ifdef __cplusplus
    extern "C" {
#endif

#include "tuya_cloud_types.h"


/*
 *  zigbee finding & binding status
 */
typedef enum {
    TKL_FB_SUCCESS = 0,
    TKL_FB_FAILED,
} TKL_FB_STATUS_E;

/*
 *  zigbee finding & binding complete callback
 */
typedef VOID_T (*TKL_FB_INITIATOR_COMP_CB)(TKL_FB_STATUS_E status);

/**
 * @brief zigbee finding & binding start as targter
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tkl_zg_find_bind_targer_start(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding stop as targter
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tkl_zg_find_bind_targer_stop(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding start as initiator
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tkl_zg_find_bind_initiator_start(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding stop as initiator
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tkl_zg_find_bind_initiator_stop(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding complete callback register
 *
 * @param[in]   complete_cb: endpoint
 * @return  OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tkl_zg_find_bind_initiator_complete_cb_register(TKL_FB_INITIATOR_COMP_CB complete_cb);

#ifdef __cplusplus
}
#endif

#endif
